<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<html>
<HEAD>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/style.css"> 
</HEAD>
<body>
<f:view>
<f:loadBundle basename="resource.bundle.messages" var="messages"/>
	<h:form>
	
	<t:panelGrid width="100%">
		<h:graphicImage url="/image/logo.gif" width="1024" height="100"></h:graphicImage>
	</t:panelGrid>
	
	<t:panelGrid columns="2" width="1024" columnClasses="standardTable_ColumnLeft_30,standardTable_ColumnTop_70" >
		<t:panelGrid>
			<rich:panel header="Existing Member">
				<t:panelGrid columns="1" align="center">
					<h:outputText value="Username or Password Invalid" styleClass="error"></h:outputText>
					<t:panelGroup>
						<t:panelGrid columns="2" >
						<t:outputText value="#{messages['username']}:" styleClass="standardText_Label"/>
						<t:inputText id="j_username" forceId="true" value="#{menuBean.cacheUserId}"></t:inputText>
						
						<t:outputText value="#{messages['password']}:" styleClass="standardText_Label"/>
						<t:inputSecret id="j_password" forceId="true" ></t:inputSecret>
						
						<t:outputText value=""></t:outputText>
						<t:commandButton value="#{messages['login']}" action="login" styleClass="button"></t:commandButton>
						</t:panelGrid>	
					</t:panelGroup>
				</t:panelGrid>
			</rich:panel>
			
			<rich:panel header="New Partner">
				<t:panelGrid columns="1" align="center">
				<h:commandButton value="#{messages['partner.registration']}" action="#{partnerRegBean.navRegParnter}" styleClass="button"></h:commandButton>
				</t:panelGrid>
			</rich:panel>
			
			<rich:panel header="New Agent">
				<t:panelGrid columns="1" align="center">
				<h:commandButton value="#{messages['agent.registration']}" action="#{agentRegBean.navRegAgent}" styleClass="button"></h:commandButton>
				</t:panelGrid>
			</rich:panel>
			
		</t:panelGrid>
		<t:panelGrid width="100%" >
			<rich:panel header="#{messages['membership']}">
					<rich:dataTable id="data" var="membership"  value="#{registrationBean.membershipList}" rows="20" width="99%">
						<rich:column style="text-align:center;width:50%;">
							<f:facet name="header">
								<h:outputText value="#{messages['name']}"></h:outputText>
							</f:facet>
							<h:outputText value="#{membership.name}"></h:outputText>
						</rich:column>
						<rich:column style="text-align:center;width:25%;">
							<f:facet name="header">
								<h:outputText value="#{messages['desc']}"></h:outputText>
							</f:facet>
							<h:outputText value="#{membership.desc}"></h:outputText>
						</rich:column>
						<rich:column style="text-align:center;width:25%;">
							<f:facet name="header">
								<h:outputText value="#{messages['price']}"></h:outputText>
							</f:facet>
							<h:outputText value="#{membership.membershipFeeDbl}">
								<f:convertNumber pattern="#,###,###,##0.00"/>
							</h:outputText>
						</rich:column>
						<rich:column style="text-align:center;width:25%;">
							<f:facet name="header">
								<h:outputText value="#{messages['action']}"></h:outputText>
							</f:facet>
							<h:commandButton value="#{messages['buy.now']}" styleClass="button" action="#{registrationBean.navSelectMemberType}" 
							actionListener="#{registrationBean.registrationListener}">
							</h:commandButton>
							<f:param id="membershipId" value="#{membership.membershipId}" />
						</rich:column>
					</rich:dataTable>
			</rich:panel>
			<rich:spacer height="120"></rich:spacer>
		</t:panelGrid>
	</t:panelGrid>
		
	</h:form>
</f:view>
</body>
</html>